;;; gambit-settings.el --- 

;; Copyright (C) 2013  gww

;; Author: gww <gww@192.168.0.171>
;; Keywords: lisp

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; 

;;; Code:
(require 'scheme)
(load-plugin-in "gambit")

;;always loading
;;(require 'gambit)

;;autoload
(autoload 'gambit-inferior-mode "gambit" "Hook Gambit mode into cmuscheme.")
(autoload 'gambit-mode "gambit" "Hook Gambit mode into scheme.")
(add-hook 'inferior-scheme-mode-hook (function gambit-inferior-mode))
(add-hook 'scheme-mode-hook (function gambit-mode))
(setq scheme-program-name "gsi -:d-")

(defun show-gambit-repl()
  (interactive)
  (setq temp-buffer-name (buffer-name (current-buffer)))
  (if (get-buffer "*scheme*")
      (switch-to-buffer-other-window "*scheme*")
    (run-scheme "gsi -:d-"))
  (switch-to-buffer-other-window temp-buffer-name)
  (show-output-window "*scheme*" t))

(add-hook 'scheme-mode-hook 
	  '(lambda ()
	     (define-key scheme-mode-map [f1] 'show-gambit-repl)
	     (define-key scheme-mode-map (kbd "C-c z") 'show-gambit-repl)))

(eval-after-load "scheme"
  '(progn ))

(provide 'mod-gambit)
;;; gambit-settings.el ends here

